package com.example.controller;

import com.example.Feign.Loginfeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.ServiceInstance;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class NacoTestController {
    @Autowired
    private DiscoveryClient discoveryClient;
    @Autowired
    private Loginfeign loginfeign;
    @GetMapping("test")
    public String test(){
        List<ServiceInstance> instances = discoveryClient.getInstances("nacos-client-b");
        System.out.println(instances);
        return loginfeign.login();
    }
}
